Skip to content

Add Oracle Cloud Infrastructure (OCI) Object Storage backend#7718

Open
harsha-yuvaraj wants to merge 6 commits into
cortexproject:masterfrom
harsha-yuvaraj:feature/oci-storage-backend
Open

Add Oracle Cloud Infrastructure (OCI) Object Storage backend#7718
harsha-yuvaraj wants to merge 6 commits into
cortexproject:masterfrom
harsha-yuvaraj:feature/oci-storage-backend

Conversation

@harsha-yuvaraj

Copy link
Copy Markdown

What this PR does:

Adds Oracle Cloud Infrastructure (OCI) Object Storage as a storage backend for blocks, ruler, and alertmanager, wrapping the OCI provider already shipped by Thanos objstore. Select it with backend: oci and configure via -<prefix>.oci.* flags.

  • pkg/storage/bucket/oci/config.go — config struct + flags (auth providers: default, instance-principal, raw, oke-workload-identity)
  • pkg/storage/bucket/oci/bucket_client.go — thin wrapper over objstore/providers/oci
  • pkg/storage/bucket/client.go — backend registration (constant, SupportedBackends, config field, NewClient case)
  • Vendored github.com/oracle/oci-go-sdk/v65

Because ruler/alertmanager/blocks validate against bucket.SupportedBackends, OCI is available to all three with no extra wiring. Retries are enabled by default (max_request_retries: 3, request_retry_interval: 10s) for parity with the other backends; the provider performs no retries when these are 0/1.

Which issue(s) this PR fixes:

Fixes #7593

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated
  • docs/configuration/v1-guarantees.md updated (OCI listed as experimental)

Signed-off-by: Harsha Yuvaraj <harshavardanyuvaraj@gmail.com>
Signed-off-by: Harsha Yuvaraj <harshavardanyuvaraj@gmail.com>
Signed-off-by: Harsha Yuvaraj <harshavardanyuvaraj@gmail.com>
Signed-off-by: Harsha Yuvaraj <harshavardanyuvaraj@gmail.com>
Signed-off-by: Harsha Yuvaraj <harshavardanyuvaraj@gmail.com>
@dosubot dosubot Bot added dependencies Pull requests that update a dependency file go Pull requests that update Go code storage/blocks Blocks storage engine labels Jul 23, 2026
@krunaljain

Copy link
Copy Markdown
Contributor

Should this PR be broken down?

@CharlieTLe CharlieTLe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @harsha-yuvaraj, thanks for working on this. Were you able to get this working in a real OCI setup?

@harsha-yuvaraj

Copy link
Copy Markdown
Author

Hi @CharlieTLe, yes, validated end-to-end against a real OCI Object Storage bucket (Always Free tier), using the default provider (~/.oci/config).

I ran the backend's full read/write cycle through NewBucketClient: Upload → Exists → Get (with content verification) → Iter → Delete, and every operation succeeded:

=== RUN   TestOCILive
level=info msg="creating OCI client" provider=default
level=info msg="getting namespace, it might take some time"
level=debug msg="Oracle Cloud Infrastructure tenancy namespace: <redacted>"
    live_test.go:51: Upload...
    live_test.go:54: Exists (expect true)...
    live_test.go:59: Get + verify content...
    live_test.go:67: Iter (expect to find the object)...
level=debug NumberOfObjects=1
    live_test.go:77: Delete...
    live_test.go:84: ALL OCI LIVE OPERATIONS PASSED
--- PASS: TestOCILive (2.51s)
PASS
ok      github.com/cortexproject/cortex/pkg/storage/bucket/oci  3.443s

The check drove the same objstore.Bucket operations Cortex uses in the blocks/ruler/alertmanager paths.

…-backend

Signed-off-by: Harsha Yuvaraj <harshavardanyuvaraj@gmail.com>

# Conflicts:
#	vendor/modules.txt
@harsha-yuvaraj

Copy link
Copy Markdown
Author

Hey @CharlieTLe, synced onto latest master and resolved the vendor/modules.txt conflict, the branch is up to date now.

One thing worth noting on the size: master now vendors oracle/oci-go-sdk/v65 and objstore/providers/oci transitively (via the Thanos v0.42.0 bump in #7691), so this PR no longer carries any vendor or go.mod/go.sum changes, that diff is now identical to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file go Pull requests that update Go code size/XL storage/blocks Blocks storage engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Oracle Cloud OCI storage backend

3 participants